/*
 * com_wits_av_JniRtpSound.cpp
 *
 *  Created on: 2018年8月28日
 *      Author: zhengboyuan
 */


#include <jni.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>

#include <android/native_window_jni.h>
#include <android/log.h>

#include "com_wits_av_JniRtpSound.h"
#include "RtpSound.h"
#include "SharedPtr.h"
#include "TCriticalSection.h"

#include "TDiscreteArray.h"


/*
 * Class:     com_wits_av_JniRtpSound
 * Method:    rtpsound_init
 * Signature: ()I
 */
JNIEXPORT jint JNICALL Java_com_wits_av_JniRtpSound_rtpsound_1init
  (JNIEnv *, jclass)
{
    return rtpsound_init();
}

/*
 * Class:     com_wits_av_JniRtpSound
 * Method:    rtpsound_quit
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_com_wits_av_JniRtpSound_rtpsound_1quit
  (JNIEnv *, jclass)
{
    rtpsound_quit();
}

/*
 * Class:     com_wits_av_JniRtpSound
 * Method:    rtpsound_open
 * Signature: (IIII)I
 */
JNIEXPORT jint JNICALL Java_com_wits_av_JniRtpSound_rtpsound_1open
  (JNIEnv *, jclass, jint port, jint codec, jint channels, jint samplerate)
{
    return rtpsound_open(port, codec, channels, samplerate);
}

/*
 * Class:     com_wits_av_JniRtpSound
 * Method:    rtpsound_close
 * Signature: (I)V
 */
JNIEXPORT void JNICALL Java_com_wits_av_JniRtpSound_rtpsound_1close
  (JNIEnv *, jclass, jint handle)
{
    rtpsound_close(handle);
}

/*
 * Class:     com_wits_av_JniRtpSound
 * Method:    rtpsound_setVolume
 * Signature: (IF)Z
 */
JNIEXPORT jboolean JNICALL Java_com_wits_av_JniRtpSound_rtpsound_1setVolume
  (JNIEnv *, jclass, jint handle, jfloat volume)
{
    return rtpsound_setVolume(handle, volume);
}

/*
 * Class:     com_wits_av_JniRtpSound
 * Method:    rtpsound_getVolume
 * Signature: (I)F
 */
JNIEXPORT jfloat JNICALL Java_com_wits_av_JniRtpSound_rtpsound_1getVolume
  (JNIEnv *, jclass, jint handle)
{
    return rtpsound_getVolume(handle);
}
